package entity.MRP.ProductionPlan;

import entity.MRP.MaterialRequirement.WeeklyMaterialReq;
import entity.MRP.SOProcess.WeeklyDemandAmendment;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

@Entity
public class PlannedWeeklyDemand extends PlannedDemand {

    @ManyToOne
    private PlannedMonthlyDemand plannedMonthlyDemand;
    @OneToMany
    private List<PlannedDailyDemand> plannedDailyDemand = new ArrayList<PlannedDailyDemand>();
    private Long numberOfWorkingDay;
    private Long weekNumber;
    private String weekPeriod;
    
    private Long weeklyDemandA;
    private Long weeklyDemandB;
    private Long weeklyDemandC;
    private Long weeklyDemandD;
    
    @OneToOne
    private WeeklyDemandAmendment weeklyDemandAmendment;
    @OneToOne
    private WeeklyMaterialReq weeklyMaterialReq;

    public Long getNumberOfWorkingDay() {
        return numberOfWorkingDay;
    }

    public void setNumberOfWorkingDay(Long numberOfWorkingDay) {
        this.numberOfWorkingDay = numberOfWorkingDay;
    }

    public List<PlannedDailyDemand> getPlannedDailyDemand() {
        return plannedDailyDemand;
    }

    public void setPlannedDailyDemand(List<PlannedDailyDemand> plannedDailyDemand) {
        this.plannedDailyDemand = plannedDailyDemand;
    }

    public PlannedMonthlyDemand getPlannedMonthlyDemand() {
        return plannedMonthlyDemand;
    }

    public void setPlannedMonthlyDemand(PlannedMonthlyDemand plannedMonthlyDemand) {
        this.plannedMonthlyDemand = plannedMonthlyDemand;
    }


    public Long getWeekNumber() {
        return weekNumber;
    }

    public void setWeekNumber(Long weekNumber) {
        this.weekNumber = weekNumber;
    }

    public String getWeekPeriod() {
        return weekPeriod;
    }

    public void setWeekPeriod(String weekPeriod) {
        this.weekPeriod = weekPeriod;
    }
    
    public Long getWeeklyDemandA() {
        return weeklyDemandA;
    }

    public void setWeeklyDemandA(Long weeklyDemandA) {
        this.weeklyDemandA = weeklyDemandA;
    }

    public Long getWeeklyDemandB() {
        return weeklyDemandB;
    }

    public void setWeeklyDemandB(Long weeklyDemandB) {
        this.weeklyDemandB = weeklyDemandB;
    }

    public Long getWeeklyDemandC() {
        return weeklyDemandC;
    }

    public void setWeeklyDemandC(Long weeklyDemandC) {
        this.weeklyDemandC = weeklyDemandC;
    }

    public Long getWeeklyDemandD() {
        return weeklyDemandD;
    }

    public void setWeeklyDemandD(Long weeklyDemandD) {
        this.weeklyDemandD = weeklyDemandD;
    }

    public Long getWeeklyDemand(String productName)
    {
        if (productName.compareTo("A") == 0) return getWeeklyDemandA();
        else if (productName.compareTo("B") == 0) return getWeeklyDemandB();
        else if (productName.compareTo("C") == 0) return getWeeklyDemandC();
        else if (productName.compareTo("D") == 0) return getWeeklyDemandD();
        else return new Long(-1);
    }

    public WeeklyDemandAmendment getWeeklyDemandAmendment() {
        return weeklyDemandAmendment;
    }

    public void setWeeklyDemandAmendment(WeeklyDemandAmendment weeklyDemandAmendment) {
        this.weeklyDemandAmendment = weeklyDemandAmendment;
    }

    public WeeklyMaterialReq getWeeklyMaterialReq() {
        return weeklyMaterialReq;
    }

    public void setWeeklyMaterialReq(WeeklyMaterialReq weeklyMaterialReq) {
        this.weeklyMaterialReq = weeklyMaterialReq;
    }
    
    
}
